import { SWFPlayer } from "../../scene/modle/SWFPlayer";
import { ObjectPool } from "../../../../com/gengine/utils/pools/ObjectPool";
import { ModelType } from "../../scene/modle/data/ModelType";
//class TaskIsOnPlayer
    
    export  class TaskIsOnPlayer /* flash.display.Sprite */
    {
        

        public toShow(arg1: Object /* flash.display.DisplayObjectContainer */): void
        {
            if (this.parent == null) 
            {
                arg1.addChild(this);
            }
            this.player.play();
            return;
        }

        public get player(): SWFPlayer
        {
            var loc1=null;
            if (!this._player) 
            {
                this._blackBg = new Object /* flash.display.Sprite */();
                this._blackBg.graphics.beginFill(0, 0.4);
                this._blackBg.graphics.drawRoundRect(1, -129, 697, 476, 5, 5);
                this._blackBg.graphics.endFill();
                this.addChild(this._blackBg);
                loc1 = new Object /* flash.display.Sprite */();
                this._player = ObjectPool.getObject(SWFPlayer);
                this._player.timeRate = 3;
                this._player.load("taskIsOn.swf", ModelType.NormalSwf, null);
                loc1.addChild(this._player);
                this.addChild(loc1);
                loc1.x = 350;
                loc1.y = 150;
            }
            return this._player;
        }

        public toHide(): void
        {
            if (this.parent != null) 
            {
                this.parent.removeChild(this);
            }
            if (this._player) 
            {
                this._player.stop();
            }
            return;
        }

        /* internal */ /* var */_player: SWFPlayer;

        /* internal */ /* var */_blackBg: Object /* flash.display.Sprite */;
    }
